        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>aabb3 class / vector_math Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="vector_math" data-type="aabb3">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../vector_math.html">vector_math</a> &rsaquo; <a href="../vector_math/aabb3.html">aabb3</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>aabb3</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class aabb3 {
 vec3 _min;
 vec3 _max;

 vec3 get min =&gt; _min;
 vec3 get max =&gt; _max;

 aabb3() {
   _min = new vec3.zero();
   _max = new vec3.zero();
 }

 aabb3.copy(aabb3 other) {
   _min = new vec3.copy(other._min);
   _max = new vec3.copy(other._max);
 }

 aabb3.minmax(vec3 min_, vec3 max_) {
   _min = new vec3.copy(min_);
   _max = new vec3.copy(max_);
 }

 void copyMinMax(vec3 min_, vec3 max_) {
   max_.copyFrom(_max);
   min_.copyFrom(_min);
 }

 void copyCenterAndHalfExtents(vec3 center, vec3 halfExtents) {
   center.copyFrom(_min);
   center.add(_max);
   center.scale(0.5);
   halfExtents.copyFrom(_max);
   halfExtents.sub(_min);
   halfExtents.scale(0.5);
 }

 void copyFrom(aabb3 o) {
   _min.copyFrom(o._min);
   _max.copyFrom(o._max);
 }

 void copyInto(aabb3 o) {
   o._min.copyFrom(_min);
   o._max.copyFrom(_max);
 }

 aabb3 transform(mat4 T) {
   vec3 center = new vec3.zero();
   vec3 halfExtents = new vec3.zero();
   copyCenterAndHalfExtents(center, halfExtents);
   T.transform3(center);
   T.absoluteRotate(halfExtents);
   _min.copyFrom(center);
   _max.copyFrom(center);

   _min.sub(halfExtents);
   _max.add(halfExtents);
   return this;
 }

 aabb3 rotate(mat4 T) {
   vec3 center = new vec3.zero();
   vec3 halfExtents = new vec3.zero();
   copyCenterAndHalfExtents(center, halfExtents);
   T.absoluteRotate(halfExtents);
   _min.copyFrom(center);
   _max.copyFrom(center);

   _min.sub(halfExtents);
   _max.add(halfExtents);
   return this;
 }

 aabb3 transformed(mat4 T, aabb3 out) {
   out.copyFrom(this);
   return out.transform(T);
 }

 aabb3 rotated(mat4 T, aabb3 out) {
   out.copyFrom(this);
   return out.rotate(T);
 }

 void getPN(vec3 planeNormal, vec3 outP, vec3 outN) {
   outP.x = planeNormal.x &lt; 0.0 ? _min.x : _max.x;
   outP.y = planeNormal.y &lt; 0.0 ? _min.y : _max.y;
   outP.z = planeNormal.z &lt; 0.0 ? _min.z : _max.z;

   outN.x = planeNormal.x &lt; 0.0 ? _max.x : _min.x;
   outN.y = planeNormal.y &lt; 0.0 ? _max.y : _min.y;
   outN.z = planeNormal.z &lt; 0.0 ? _max.z : _min.z;
 }
}
</pre>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="aabb3">
<button class="show-code">Code</button>
new <strong>aabb3</strong>() <a class="anchor-link" href="#aabb3"
              title="Permalink to aabb3.aabb3">#</a></h4>
<div class="doc">
<pre class="source">
aabb3() {
 _min = new vec3.zero();
 _max = new vec3.zero();
}
</pre>
</div>
</div>
<div class="method"><h4 id="aabb3.copy">
<button class="show-code">Code</button>
new <strong>aabb3.copy</strong>(<a href="../vector_math/aabb3.html">aabb3</a> other) <a class="anchor-link" href="#aabb3.copy"
              title="Permalink to aabb3.aabb3.copy">#</a></h4>
<div class="doc">
<pre class="source">
aabb3.copy(aabb3 other) {
 _min = new vec3.copy(other._min);
 _max = new vec3.copy(other._max);
}
</pre>
</div>
</div>
<div class="method"><h4 id="aabb3.minmax">
<button class="show-code">Code</button>
new <strong>aabb3.minmax</strong>(<a href="../vector_math/vec3.html">vec3</a> min_, <a href="../vector_math/vec3.html">vec3</a> max_) <a class="anchor-link" href="#aabb3.minmax"
              title="Permalink to aabb3.aabb3.minmax">#</a></h4>
<div class="doc">
<pre class="source">
aabb3.minmax(vec3 min_, vec3 max_) {
 _min = new vec3.copy(min_);
 _max = new vec3.copy(max_);
}
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="max">
<button class="show-code">Code</button>
final <a href="../vector_math/vec3.html">vec3</a>         <strong>max</strong> <a class="anchor-link"
            href="#max"
            title="Permalink to aabb3.max">#</a>
        </h4>
        <div class="doc">
<pre class="source">
vec3 get max =&gt; _max;
</pre>
</div>
</div>
<div class="field"><h4 id="min">
<button class="show-code">Code</button>
final <a href="../vector_math/vec3.html">vec3</a>         <strong>min</strong> <a class="anchor-link"
            href="#min"
            title="Permalink to aabb3.min">#</a>
        </h4>
        <div class="doc">
<pre class="source">
vec3 get min =&gt; _min;
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="copyCenterAndHalfExtents">
<button class="show-code">Code</button>
void <strong>copyCenterAndHalfExtents</strong>(<a href="../vector_math/vec3.html">vec3</a> center, <a href="../vector_math/vec3.html">vec3</a> halfExtents) <a class="anchor-link" href="#copyCenterAndHalfExtents"
              title="Permalink to aabb3.copyCenterAndHalfExtents">#</a></h4>
<div class="doc">
<pre class="source">
void copyCenterAndHalfExtents(vec3 center, vec3 halfExtents) {
 center.copyFrom(_min);
 center.add(_max);
 center.scale(0.5);
 halfExtents.copyFrom(_max);
 halfExtents.sub(_min);
 halfExtents.scale(0.5);
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyFrom">
<button class="show-code">Code</button>
void <strong>copyFrom</strong>(<a href="../vector_math/aabb3.html">aabb3</a> o) <a class="anchor-link" href="#copyFrom"
              title="Permalink to aabb3.copyFrom">#</a></h4>
<div class="doc">
<pre class="source">
void copyFrom(aabb3 o) {
 _min.copyFrom(o._min);
 _max.copyFrom(o._max);
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyInto">
<button class="show-code">Code</button>
void <strong>copyInto</strong>(<a href="../vector_math/aabb3.html">aabb3</a> o) <a class="anchor-link" href="#copyInto"
              title="Permalink to aabb3.copyInto">#</a></h4>
<div class="doc">
<pre class="source">
void copyInto(aabb3 o) {
 o._min.copyFrom(_min);
 o._max.copyFrom(_max);
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyMinMax">
<button class="show-code">Code</button>
void <strong>copyMinMax</strong>(<a href="../vector_math/vec3.html">vec3</a> min_, <a href="../vector_math/vec3.html">vec3</a> max_) <a class="anchor-link" href="#copyMinMax"
              title="Permalink to aabb3.copyMinMax">#</a></h4>
<div class="doc">
<pre class="source">
void copyMinMax(vec3 min_, vec3 max_) {
 max_.copyFrom(_max);
 min_.copyFrom(_min);
}
</pre>
</div>
</div>
<div class="method"><h4 id="getPN">
<button class="show-code">Code</button>
void <strong>getPN</strong>(<a href="../vector_math/vec3.html">vec3</a> planeNormal, <a href="../vector_math/vec3.html">vec3</a> outP, <a href="../vector_math/vec3.html">vec3</a> outN) <a class="anchor-link" href="#getPN"
              title="Permalink to aabb3.getPN">#</a></h4>
<div class="doc">
<pre class="source">
void getPN(vec3 planeNormal, vec3 outP, vec3 outN) {
 outP.x = planeNormal.x &lt; 0.0 ? _min.x : _max.x;
 outP.y = planeNormal.y &lt; 0.0 ? _min.y : _max.y;
 outP.z = planeNormal.z &lt; 0.0 ? _min.z : _max.z;

 outN.x = planeNormal.x &lt; 0.0 ? _max.x : _min.x;
 outN.y = planeNormal.y &lt; 0.0 ? _max.y : _min.y;
 outN.z = planeNormal.z &lt; 0.0 ? _max.z : _min.z;
}
</pre>
</div>
</div>
<div class="method"><h4 id="rotate">
<button class="show-code">Code</button>
<a href="../vector_math/aabb3.html">aabb3</a> <strong>rotate</strong>(<a href="../vector_math/mat4.html">mat4</a> T) <a class="anchor-link" href="#rotate"
              title="Permalink to aabb3.rotate">#</a></h4>
<div class="doc">
<pre class="source">
aabb3 rotate(mat4 T) {
 vec3 center = new vec3.zero();
 vec3 halfExtents = new vec3.zero();
 copyCenterAndHalfExtents(center, halfExtents);
 T.absoluteRotate(halfExtents);
 _min.copyFrom(center);
 _max.copyFrom(center);

 _min.sub(halfExtents);
 _max.add(halfExtents);
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="rotated">
<button class="show-code">Code</button>
<a href="../vector_math/aabb3.html">aabb3</a> <strong>rotated</strong>(<a href="../vector_math/mat4.html">mat4</a> T, <a href="../vector_math/aabb3.html">aabb3</a> out) <a class="anchor-link" href="#rotated"
              title="Permalink to aabb3.rotated">#</a></h4>
<div class="doc">
<pre class="source">
aabb3 rotated(mat4 T, aabb3 out) {
 out.copyFrom(this);
 return out.rotate(T);
}
</pre>
</div>
</div>
<div class="method"><h4 id="transform">
<button class="show-code">Code</button>
<a href="../vector_math/aabb3.html">aabb3</a> <strong>transform</strong>(<a href="../vector_math/mat4.html">mat4</a> T) <a class="anchor-link" href="#transform"
              title="Permalink to aabb3.transform">#</a></h4>
<div class="doc">
<pre class="source">
aabb3 transform(mat4 T) {
 vec3 center = new vec3.zero();
 vec3 halfExtents = new vec3.zero();
 copyCenterAndHalfExtents(center, halfExtents);
 T.transform3(center);
 T.absoluteRotate(halfExtents);
 _min.copyFrom(center);
 _max.copyFrom(center);

 _min.sub(halfExtents);
 _max.add(halfExtents);
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="transformed">
<button class="show-code">Code</button>
<a href="../vector_math/aabb3.html">aabb3</a> <strong>transformed</strong>(<a href="../vector_math/mat4.html">mat4</a> T, <a href="../vector_math/aabb3.html">aabb3</a> out) <a class="anchor-link" href="#transformed"
              title="Permalink to aabb3.transformed">#</a></h4>
<div class="doc">
<pre class="source">
aabb3 transformed(mat4 T, aabb3 out) {
 out.copyFrom(this);
 return out.transform(T);
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
